package com.wttm.client;

import com.google.gwt.user.client.ui.Anchor;
import com.google.gwt.user.client.ui.Composite;
import com.google.gwt.user.client.ui.Label;
import com.google.gwt.user.client.ui.RootPanel;
import com.google.gwt.user.client.ui.VerticalPanel;
import com.wttm.shared.LoginInfo;
import com.google.gwt.user.client.ui.Image;

public class WelcomePage extends Composite {

	private LoginInfo loginInfo;
	private Anchor signOutLink = new Anchor("Sign Out");
		
	public WelcomePage(LoginInfo info) {
		loginInfo = info;
		
		VerticalPanel mainPanel = new VerticalPanel();
		Label welcomeLabel = new Label("Welcome " + loginInfo.getNickname());
		signOutLink.setHref(loginInfo.getLogoutUrl());
		
		Image image = new Image(Util.getImgRes().earthMoon());
		mainPanel.add(image);
		
		mainPanel.add(welcomeLabel);
		mainPanel.add(signOutLink);
		
		RootPanel.get("content").add(mainPanel);
	}
}
